﻿<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>银监会全文检索系统-TRS</title>
<style type="text/css">
<!--
body{font-family: Arial, sans-serif;text-align:left;margin:0;padding:0; background:#FFF;font-size:12px;color:#000; height:100%;}
/* 下边这句 和validate的css有冲突  故注释掉*/
/* body > div{text-align:left;margin-right:auto;margin-left:auto; height:100%;} */
div,form,ul,ol,li,span,p{margin:0;padding:0;border:0;}
img,a img{border:0;margin:0;padding:0;}
h1,h2,h3,h4,h5,h6{margin:0;padding:0;}
table,td,input{font-size:12px;padding:0}
ul,ol,li{list-style:none}
.btn {font-size:12px;height:2em;*padding-top:2px;width:5.6em;margin-left:3px}
.btn {vertical-align:middle;*vertical-align:baseline}
.i {vertical-align:middle;*vertical-align:baseline}
-->
</style>
</head>
<SCRIPT language=JavaScript>
<!--

file://锁鼠标右键和键盘CONTEXTMENU键
function click(e) {
if (document.all) {
if (event.button==2||event.button==3)
{ 
//alert("禁止右键");
oncontextmenu='return false';
}
}
if (document.layers) {
if (e.which == 3) {
oncontextmenu='return false';
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
document.oncontextmenu = new Function("return false;")

// -->
</SCRIPT>

<script language="javascript">
<!--
function pickDate(objOb){
			var	strURL	= "datepicker.html";
			var	strIni	= objOb.value;
			var	strFtr	= "dialogHeight: 240px; dialogWidth: 320px; ";
			strFtr	= strFtr + "dialogLeft: " + window.event.screenX + "px; ";
			strFtr	= strFtr + "dialogTop: " + window.event.screenY + "px; ";
			strFtr	= strFtr + "edge: Sunken; center: no; help: No; resizable: No; scroll: No; status: No;"
			var	strVal	= window.showModalDialog (strURL, strIni,strFtr);		
			if (strVal != ""){
				objOb.value	= strVal;
			}
		}

function search(thisform)
{
	var word=document.getElementById("swd").value;
	word=word.replace(/^\s\s*/,"").replace(/\s\s*$/,"");
	if(word==""){
		alert("请输入检索词");
		return false;
	}
	var sdate=document.getElementById("idStartDate").value;
	var edate=document.getElementById("idEndDate").value;
	var Gtype=document.getElementById("GWType").options[document.getElementById("GWType").selectedIndex].value;
	var dateandtype=getDateAndType(sdate,edate,Gtype);
	thisform.searchword.value="TITLE/10,CONTENT/2,KEY_WORDS/1,APPENDIX/1,FJFILENAME/1+=like(%"+word+"%)"+dateandtype;	
	//thisform.searchword.value="TITLE/10,CONTENT/2,KEY_WORDS/1,APPENDIX/1+="+word;
	//alert(thisform.searchword.value);
	return true;
}

function searchForm()
{
	var word=document.searchform.swd.value;
	var satKong=word.indexOf(" ",0);
	//alert(satKong);
	word=word.replace(/^\s\s*/,"").replace(/\s\s*$/,"");
	word=word.replace("-","\\-");
	word=word.replace("'","").replace("'","").replace("'","").replace("'","").replace("'","").replace("'","").replace("'","").replace("'","").replace("'","").replace("'","").replace("'","");
	word=word.replace("<","").replace("<","").replace("<","").replace("<","").replace("<","").replace("<","").replace("<","").replace("<","").replace("<","").replace("<","").replace("<","");
	word=word.replace(">","").replace(">","").replace(">","").replace(">","").replace(">","").replace(">","").replace(">","").replace(">","").replace(">","").replace(">","").replace(">","");

	//alert(word);

	var sdate=document.searchform.dc1.value;
	var edate=document.searchform.dc2.value;
	sdate=sdate.replace("-",".").replace("-",".");
	edate=edate.replace("-",".").replace("-",".");
	var Gtype=document.searchform.GWType.options[document.searchform.GWType.selectedIndex].value;
	//var dateandtype=getDateAndType(sdate,edate,Gtype);getDateAndType(v_sdate,v_edate,type);
	var dateandtype="";
			var SQLDate,SQLType,SQL;
			SQLDate=SQL=SQLType="";
			var va_sdate = new Array(3);
			var va_edate = new Array(3);
			if(sdate!=""&&edate!=""){
				va_sdate = sdate.split(".");
				va_edate = edate.split(".");
				if(new Date(va_sdate[0],va_sdate[1],va_sdate[2])>new Date(va_edate[0],va_edate[1],va_edate[2])){
					alert("起始日期应该小于终止日期");	
					return false;
				}
				SQLDate="DRAFT_DATE="+sdate+" to "+edate;
			}else if(sdate!=""&&edate==""){
				SQLDate="DRAFT_DATE>="+sdate;
			}else if(sdate==""&&edate!=""){
				alert("如果选择了终止日期，那么必须选择起始日期");
				return false;
			}else{
				SQLDate="";
			}
			if(Gtype!="ALL"){
				SQLType="TYPE2="+Gtype+"%";
			}else{
				SQLType="";
			}
			if(SQLDate!=""&&SQLType!=""){
				SQL=" AND "+SQLDate+" AND "+SQLType;
			}else if(SQLDate==""&&SQLType!=""){
				SQL=" AND "+SQLType;
			}else if(SQLDate!=""&&SQLType==""){
				SQL=" AND "+SQLDate;
			}else{
				SQL="";
			}
			dateandtype=SQL;

	var mySql="";
	//if (word=="")
	//{
	//  var	Length=dateandtype.length;
	//  dateandtype=dateandtype.substring(4,Length);
	//  document.searchform.searchword.value=dateandtype;	
	//}else
	//{
	if (satKong>0)
	{
	  document.searchform.searchword.value="TITLE/10,CONTENT/2,KEY_WORDS/1,APPENDIX/1,FJFILENAME/1+=like(%"+word+"%)"+dateandtype;	
	}else
	{
	  document.searchform.searchword.value="TITLE/10,CONTENT/2,KEY_WORDS/1,APPENDIX/1,FJFILENAME/1+=%"+word+"%"+dateandtype;	
	}
	//}
	//thisform.searchword.value="TITLE/10,CONTENT/2,KEY_WORDS/1,APPENDIX/1+="+word;
	mySql=word+dateandtype;
	//alert(mySql);
		//if(mySql=="")
		if(word=="")
		{
			alert("请输入检索词");
			return false;
		}
	//return true;
}

function getDateAndType(v_sdate,v_edate,type) {
			var SQLDate,SQLType;
			SQLDate=SQL=SQLType="";
			var va_sdate = new Array(3);
			var va_edate = new Array(3);
			if(v_sdate!=""&&v_edate!=""){
				va_sdate = v_sdate.split(".");
				va_edate = v_edate.split(".");
				if(new Date(va_sdate[0],va_sdate[1],va_sdate[2])>new Date(va_edate[0],va_edate[1],va_edate[2])){
					alert("起始日期应该小于终止日期");	
					return false;
				}
				SQLDate="DRAFT_DATE="+v_sdate+" to "+v_edate;
			}else if(v_sdate!=""&&v_edate==""){
				SQLDate="DRAFT_DATE>="+v_sdate;
			}else if(v_sdate==""&&v_edate!=""){
				alert("如果选择了终止日期，那么必须选择起始日期");
				return false;
			}else{
				SQLDate="";
			}
			if(type!="ALL"){
				SQLType="TYPE2="+type+"%";
			}else{
				SQLType="";
			}
			if(SQLDate!=""&&SQLType!=""){
				SQL=" AND "+SQLDate+" AND "+SQLType;
			}else if(SQLDate==""&&SQLType!=""){
				SQL=" AND "+SQLType;
			}else if(SQLDate!=""&&SQLType==""){
				SQL=" AND "+SQLDate;
			}else{
				SQL="";
			}
			return SQL;
		}
-->
</script>
<body onload="document.getElementById('swd').focus()"> 

<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="66" background="images_trs/top.jpg">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="top">   
		<form name=searchform action="http://10.1.240.171:8080/wasdemo/search" method="get" onsubmit="return searchForm()">
		<input type="hidden" name="channelid" id="channelid" value="152174">
		<input type="hidden" name="searchword" id="channelid" value="">
    <table width="500" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="50" align="center">&nbsp;</td>
      </tr>
      <tr>
        <td height="100" align="center"><img src="images_trs/logo.jpg" width="303" height="58" /></td>
      </tr>
      <tr>
        <td>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="81%"><label>
              <input type="text" name="swd" style="width:400px; height:21px" />
            </label></td>
            <td width="19%"><input name="Submit232133" type="submit" id="su" value="搜  索" class="btn"  style=" color:#000000; width:93px; height:23px; padding:3px; border:0px; background-image:url(images_trs/bt1.jpg)" onmouseover="javascript:this.style.backgroundImage='url(images_trs/bt2.jpg)';" onmouseout="javascript:this.style.backgroundImage='url(images_trs/bt1.jpg)';"/></td>
          </tr>
        </table>
		</td>
      </tr>
      <tr>
        <td height="20"><table width="100%" border="0" style="margin-top:20px;" cellspacing="0" cellpadding="0">
          <tr>
            <td width="8%">类型：</td>
            <td width="16%"><select id="GWtype" name="GWType" style="height:20px; font-size:12px; width:70px;">
					<option value="ALL" selected>全部</option>
					<option value="shou">收文</option>
					<option value="fa">发文</option>
					<option value="qian">签文</option>
					<option value="zi">自由文</option>
            </select></td>
            <td width="12%">起始时间：</td>
            <td width="18%">
			<input id=idStartDate name=dc1 style="width:80px; height:21px">
						
			</td>
            <td width="7%">
			<a hideFocus onClick="pickDate(idStartDate)" href="javascript:void(0)">
							<img width="22" height="19" alt="" src="images_trs/calbtn.gif" align=absMiddle border=0 name=popcal>
						</a></td>
            <td width="12%">结束日期：</td>
            <td width="18%">
			<input id=idEndDate name=dc2 style="width:80px; height:21px"></td>
            <td width="9%"><a hideFocus onClick="pickDate(idEndDate)" href="javascript:void(0)"> 
							<img height=19 alt="" src="images_trs/calbtn.gif" width=22 align=absMiddle border=0 name=popcal>
						</a></td>
          </tr>
        </table>
</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="19" background="images_trs/foot.jpg">&nbsp;</td>
  </tr>
</table>

</body>
</html>
